const mockRegionCategories = [
  {
    letter: 'A~E',
    regions: [
      { name: '安徽', code: '882001', url: 'http://q.10jqka.com.cn/dy/detail/code/882001/' },
      { name: '北京', code: '882002', url: 'http://q.10jqka.com.cn/dy/detail/code/882002/' },
      { name: '重庆', code: '882003', url: 'http://q.10jqka.com.cn/dy/detail/code/882003/' }
    ]
  },
  {
    letter: 'F~J',
    regions: [
      { name: '福建', code: '882005', url: 'http://q.10jqka.com.cn/dy/detail/code/882005/' },
      { name: '广东(除深圳)', code: '882008', url: 'http://q.10jqka.com.cn/dy/detail/code/882008/' },
      { name: '甘肃', code: '882006', url: 'http://q.10jqka.com.cn/dy/detail/code/882006/' },
      { name: '广西', code: '882009', url: 'http://q.10jqka.com.cn/dy/detail/code/882009/' },
      { name: '贵州', code: '882010', url: 'http://q.10jqka.com.cn/dy/detail/code/882010/' },
      { name: '河北', code: '882012', url: 'http://q.10jqka.com.cn/dy/detail/code/882012/' },
      { name: '湖北', code: '882014', url: 'http://q.10jqka.com.cn/dy/detail/code/882014/' },
      { name: '黑龙江', code: '882004', url: 'http://q.10jqka.com.cn/dy/detail/code/882004/' },
      { name: '湖南', code: '882015', url: 'http://q.10jqka.com.cn/dy/detail/code/882015/' },
      { name: '海南', code: '882011', url: 'http://q.10jqka.com.cn/dy/detail/code/882011/' },
      { name: '河南', code: '882013', url: 'http://q.10jqka.com.cn/dy/detail/code/882013/' },
      { name: '吉林', code: '882016', url: 'http://q.10jqka.com.cn/dy/detail/code/882016/' },
      { name: '江苏', code: '882017', url: 'http://q.10jqka.com.cn/dy/detail/code/882017/' },
      { name: '江西', code: '882018', url: 'http://q.10jqka.com.cn/dy/detail/code/882018/' }
    ]
  },
  {
    letter: 'K~O',
    regions: [
      { name: '辽宁', code: '882019', url: 'http://q.10jqka.com.cn/dy/detail/code/882019/' },
      { name: '内蒙古', code: '882020', url: 'http://q.10jqka.com.cn/dy/detail/code/882020/' },
      { name: '宁夏', code: '882021', url: 'http://q.10jqka.com.cn/dy/detail/code/882021/' }
    ]
  },
  {
    letter: 'P~T',
    regions: [
      { name: '浦东', code: '882026', url: 'http://q.10jqka.com.cn/dy/detail/code/882026/' },
      { name: '青海', code: '882022', url: 'http://q.10jqka.com.cn/dy/detail/code/882022/' },
      { name: '四川', code: '882028', url: 'http://q.10jqka.com.cn/dy/detail/code/882028/' },
      { name: '山东', code: '882023', url: 'http://q.10jqka.com.cn/dy/detail/code/882023/' },
      { name: '上海(除浦东)', code: '882027', url: 'http://q.10jqka.com.cn/dy/detail/code/882027/' },
      { name: '陕西', code: '882025', url: 'http://q.10jqka.com.cn/dy/detail/code/882025/' },
      { name: '山西', code: '882024', url: 'http://q.10jqka.com.cn/dy/detail/code/882024/' },
      { name: '深圳', code: '882007', url: 'http://q.10jqka.com.cn/dy/detail/code/882007/' },
      { name: '天津', code: '882029', url: 'http://q.10jqka.com.cn/dy/detail/code/882029/' }
    ]
  },
  {
    letter: 'U~Z',
    regions: [
      { name: '西藏', code: '882030', url: 'http://q.10jqka.com.cn/dy/detail/code/882030/' },
      { name: '新疆', code: '882031', url: 'http://q.10jqka.com.cn/dy/detail/code/882031/' },
      { name: '云南', code: '882032', url: 'http://q.10jqka.com.cn/dy/detail/code/882032/' },
      { name: '浙江', code: '882033', url: 'http://q.10jqka.com.cn/dy/detail/code/882033/' }
    ]
  }
];

// 模拟地域行情数据
const mockRegionData = [
  {
    rank: '1',
    region: {
      name: '内蒙古',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882020/',
      code: '882020'
    },
    change: {
      value: '-0.41',
      isNegative: true
    },
    volume: '1087.64',
    amount: '91.18',
    netflow: '-3.49',
    upCount: '12',
    downCount: '15',
    avgPrice: '8.38',
    leadingStock: {
      name: '天和磁材',
      url: 'http://stockpage.10jqka.com.cn/603072/',
      latestPrice: '44.86',
      change: '10.01'
    }
  },
  {
    rank: '2',
    region: {
      name: '云南',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882032/',
      code: '882032'
    },
    change: {
      value: '-0.86',
      isNegative: true
    },
    volume: '1364.84',
    amount: '136.33',
    netflow: '-2.11',
    upCount: '15',
    downCount: '24',
    avgPrice: '9.99',
    leadingStock: {
      name: '川金诺',
      url: 'http://stockpage.10jqka.com.cn/300505/',
      latestPrice: '17.25',
      change: '9.59'
    }
  },
  {
    rank: '3',
    region: {
      name: '浦东',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882026/',
      code: '882026'
    },
    change: {
      value: '-0.86',
      isNegative: true
    },
    volume: '3533.90',
    amount: '484.38',
    netflow: '-25.17',
    upCount: '49',
    downCount: '104',
    avgPrice: '13.71',
    leadingStock: {
      name: '振华重工',
      url: 'http://stockpage.10jqka.com.cn/600320/',
      latestPrice: '5.41',
      change: '9.96'
    }
  },
  {
    rank: '4',
    region: {
      name: '青海',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882022/',
      code: '882022'
    },
    change: {
      value: '-0.88',
      isNegative: true
    },
    volume: '406.86',
    amount: '33.15',
    netflow: '0.68',
    upCount: '4',
    downCount: '6',
    avgPrice: '8.15',
    leadingStock: {
      name: '正平股份',
      url: 'http://stockpage.10jqka.com.cn/603843/',
      latestPrice: '4.00',
      change: '4.99'
    }
  },
  {
    rank: '5',
    region: {
      name: '甘肃',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882006/',
      code: '882006'
    },
    change: {
      value: '-0.93',
      isNegative: true
    },
    volume: '1552.81',
    amount: '85.76',
    netflow: '-6.48',
    upCount: '10',
    downCount: '20',
    avgPrice: '5.52',
    leadingStock: {
      name: '读者传媒',
      url: 'http://stockpage.10jqka.com.cn/603999/',
      latestPrice: '6.89',
      change: '10.06'
    }
  },
  {
    rank: '6',
    region: {
      name: '河南',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882013/',
      code: '882013'
    },
    change: {
      value: '-0.99',
      isNegative: true
    },
    volume: '3695.20',
    amount: '337.14',
    netflow: '-7.07',
    upCount: '40',
    downCount: '68',
    avgPrice: '9.12',
    leadingStock: {
      name: '四方达',
      url: 'http://stockpage.10jqka.com.cn/300179/',
      latestPrice: '12.35',
      change: '15.10'
    }
  },
  {
    rank: '7',
    region: {
      name: '安徽',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882001/',
      code: '882001'
    },
    change: {
      value: '-1.01',
      isNegative: true
    },
    volume: '4119.19',
    amount: '435.43',
    netflow: '-20.52',
    upCount: '59',
    downCount: '127',
    avgPrice: '10.57',
    leadingStock: {
      name: '合锻智能',
      url: 'http://stockpage.10jqka.com.cn/603011/',
      latestPrice: '10.22',
      change: '10.01'
    }
  },
  {
    rank: '8',
    region: {
      name: '辽宁',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882019/',
      code: '882019'
    },
    change: {
      value: '-1.02',
      isNegative: true
    },
    volume: '2415.17',
    amount: '245.40',
    netflow: '-13.95',
    upCount: '30',
    downCount: '50',
    avgPrice: '10.16',
    leadingStock: {
      name: '大连重工',
      url: 'http://stockpage.10jqka.com.cn/002204/',
      latestPrice: '7.70',
      change: '10.00'
    }
  },
  {
    rank: '9',
    region: {
      name: '河北',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882012/',
      code: '882012'
    },
    change: {
      value: '-1.06',
      isNegative: true
    },
    volume: '2042.77',
    amount: '221.24',
    netflow: '-12.81',
    upCount: '28',
    downCount: '51',
    avgPrice: '10.83',
    leadingStock: {
      name: '恒工精密',
      url: 'http://stockpage.10jqka.com.cn/301261/',
      latestPrice: '131.92',
      change: '9.25'
    }
  },
  {
    rank: '10',
    region: {
      name: '山西',
      url: 'http://q.10jqka.com.cn/dy/detail/code/882024/',
      code: '882024'
    },
    change: {
      value: '-1.09',
      isNegative: true
    },
    volume: '1642.44',
    amount: '101.90',
    netflow: '-8.13',
    upCount: '7',
    downCount: '30',
    avgPrice: '6.20',
    leadingStock: {
      name: '北方铜业',
      url: 'http://stockpage.10jqka.com.cn/000737/',
      latestPrice: '11.17',
      change: '10.05'
    }
  }
];

export const fetchRegionCategories = async () => {
  await new Promise(resolve => setTimeout(resolve, 300));
  return mockRegionCategories;
};

export const fetchRegionData = async () => {
  await new Promise(resolve => setTimeout(resolve, 500));
  return mockRegionData;
};
export const getCategoryUrl = (category) => {
  const baseUrl = 'https://q.10jqka.com.cn';
  
  switch (category) {
    case 'concept':
      return `${baseUrl}/gn/`;
    case 'region':
      return `${baseUrl}/dy/`;
    case 'industry':
      return `${baseUrl}/thshy/`;
    case 'regulatory':
      return `${baseUrl}/zjhhy/`;
    default:
      return `${baseUrl}/dy/`;
  }
};